<?php

class modParticipants extends model
{
	function hasParticipants($conv, $parts)
	{
		// Make the WHERE clause
		$personsQ = implode(" OR user = ", $parts);
		$personsQ = " user = " . $personsQ;
		
		// Check if they got the RIGHT participants.
		$participants = $this->query("SELECT 1 FROM participants WHERE closed = 0 AND conv = '" . $conv . "' AND (" . $personsQ . ");");
		
		if ($this->num($participants) == count($parts))
			return true;
		else
			return false;
			
			
	} // end function
		
	
} // end class

$_ = 'modParticipants';

?>